/*package com.qhgrain.demo.authz;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;

public class DbUserAuthFilter extends FormAuthenticationFilter{

	@Override
	protected AuthenticationToken createToken(ServletRequest request,
			ServletResponse response) {
		System.out.println("********************create token*****************************");
		String userName=request.getParameter("userName");
		String password=request.getParameter("password");
		UsernamePasswordToken token=new UsernamePasswordToken(userName,password);
		return token;
	}

	@Override
	protected boolean onLoginSuccess(AuthenticationToken token,
			Subject subject, ServletRequest request, ServletResponse response)
			throws Exception {
		System.out.println("login success");
		return super.onLoginSuccess(token, subject, request, response);
	}

	@Override
	protected boolean onLoginFailure(AuthenticationToken token,
			AuthenticationException e, ServletRequest request,
			ServletResponse response) {
		// TODO Auto-generated method stub
		return super.onLoginFailure(token, e, request, response);
	}

}
*/